<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        .box1:before {
            content: "before content hello!";
            color: tomato;
            font-size: 30px;
            display: block;
        }
        .box1:after {
            content: "after content css!";
            color: greenyellow;
            font-size: 40px;
            display: block;
        }
    </style>
</head>
<body>
    <div class="box1">伪元素</div>
</body>
</html>